IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'AccountCreate')
	BEGIN
		DROP  Procedure  AccountCreate
	END

GO

CREATE Procedure AccountCreate
(
	@title nvarchar(200),
	@code nvarchar(10),
	@typeFlags int,
	@guid nvarchar(50),
	@currency char(3),
	@accountId int OUTPUT
)
AS

INSERT INTO Accounts
	(Title, Code, CreateDate, UpdateDate, TypeFlags, Guid, Currency)
VALUES
	(@title, @code, GETDATE(), GETDATE(), @typeFlags, @guid, @currency)
	
SET @accountId = SCOPE_IDENTITY()

GO

